#include "utils.h"

void *safe_malloc(int size) {
    void *mymem;
    fflush(stdout);
    if (size < 0)
        fatal("Tried to malloc negative amount of memory!!!");
    mymem = malloc(size);
    if (mymem == NULL)
        fatal("Malloc Failed! Probably out of space.");
    fflush(stdout);
    return mymem;
}



